unit refactorings;

interface
uses
  PortalGrid, ExtCtrls;

procedure DrawArrow(Grid: TPortalGrid; Image: TImage; const polytop, h1Offset, h2: integer);

implementation
uses
  Types, Graphics;

procedure DrawArrow(Grid: TPortalGrid; Image: TImage; const polytop, h1Offset, h2: integer);
var h1: integer;
begin
  Image.canvas.pen.color:=clblack;
  Image.canvas.brush.color:=clbtnface;
  Image.canvas.pen.width:=1;
  Image.canvas.polygon([point(-5,-5),point(25,-5),
    point(25,polytop),point(-5,polytop),point(-5,-5)]);
  //draw arrow base
  h1:=(18* Grid.Row) + h1Offset;
  Image.canvas.moveto(0,h1);
  Image.canvas.lineto(5,h1);
  //draw arrow tip
  Image.canvas.moveto(11,h2);
  Image.canvas.lineto(20,h2);
  Image.canvas.moveto(14,h2-3);
  Image.canvas.lineto(19,h2);
  Image.canvas.lineto(14,h2+3);
  //draw arrow body
  Image.canvas.moveto(5,h1);
  Image.canvas.lineto(11,h2);
end;

end.
